import request from '@/utils/request'

export const getAcList = (params: any) => {
  return request({
    url: '/subAccounts/list',
    method: 'get',
    params
  })
}

// 修改---启用禁用接口
export const enableOrDisableAc = (params: any) => {
  return request({
    url: `/subAccounts/status/${params.isDeleted}`,
    method: 'post',
    params: { id: params.id }
  })
}

// 新增---添加员工
export const addAc = (params: any) => {
  return request({
    url: '/subAccounts',
    method: 'post',
    data: { ...params }
  })
}

// 修改---添加员工
export const editAc = (params: any) => {
  return request({
    url: '/subAccounts',
    method: 'put',
    data: { ...params }
  })
}

// 修改页面反查详情接口
export const queryAcById = (id: string | (string | null)[]) => {
  return request({
    url: `/subAccounts/${id}`,
    method: 'get'
  })
}
// 修改页面反查详情接口
export const queryAcDetailById = (id: string | (string | null)[]) => {
  return request({
    url: `/wallets/byAccountId/${id}`,
    method: 'get'
  })
}
// 新增---添加员工
export const editAcDetail = (params: any, id: string | (string | null)[]) => {
  return request({
    url: `/wallets/${id}`,
    method: 'put',
    data: { ...params }
  })
}
